package com.cppba.controller;

import com.cppba.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author timingbar
 * @created 2017/7/6 0006 16:00
 */
@Controller
@RequestMapping("/city")
public class CityController {
	private final CityService cityService;

	@Autowired
	public CityController(CityService cityService) {
		this.cityService = cityService;
	}

	@RequestMapping("/findByParentId")
	@ResponseBody
	public List findByParentId(Long parentId) {
		return cityService.findByParentId(parentId);
	}
}
